package com.qianxx.component.activity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.AdapterView;
import android.widget.ArrayAdapter;
import android.widget.ListView;

import com.qianxx.component.R;
import com.qianxx.component.activity.base.BaseActivity;
import com.qianxx.component.activity.effects.app_bar_layout.AppBarLayoutActivity;
import com.qianxx.component.activity.effects.bezier_view.BezierViewActivity;
import com.qianxx.component.activity.effects.scratch_area.ScratchAreaActivity;
import com.qianxx.component.activity.effects.scroll_panel.ScrollPanelActivity;
import com.qianxx.component.activity.effects.shopping_car.ShoppingCarActivity;
import com.qianxx.component.activity.effects.view_filpper.ViewFlipperActivity;
import com.qianxx.component.activity.effects.waves.WavesActivity;
import com.qianxx.component.activity.image.scroll_view_container.ScrollViewContainerActivity;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnItemClick;

public class EffectsActivity extends BaseActivity {
    @BindView(R.id.lv)
    ListView lv;
    ArrayAdapter adapter;
    String[] listItems = {"ScrollViewContainer", "BezierView", "Waves",
            "AppBarLayout", "ShoppingCar", "ScratchArea",
            "ViewFlipper","ScrollPanel"};

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_effects);
        ButterKnife.bind(this);

        adapter = new ArrayAdapter(this, R.layout.item, listItems);
        lv.setAdapter(adapter);
    }

    @OnItemClick(R.id.lv)
    void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
        Class cls = null;
        switch (arg2) {
            case 0:
                cls = ScrollViewContainerActivity.class;
                break;
            case 1:
                cls = BezierViewActivity.class;
                break;
            case 2:
                cls = WavesActivity.class;
                break;
            case 3:
                cls = AppBarLayoutActivity.class;
                break;
            case 4:
                cls = ShoppingCarActivity.class;
                break;
            case 5:
                cls = ScratchAreaActivity.class;
                break;
            case 6:
                cls = ViewFlipperActivity.class;
                break;
            case 7:
                cls = ScrollPanelActivity.class;
                break;

        }
        Intent intent = new Intent(this, cls);
        startActivity(intent);
    }

    @Override
    public String setTitle() {
        return "特效类";
    }
}